package top.leinx.fxnotes.stage;

/**
 * @Author : xiaolei
 * @DateTime: 2021/3/11 11:47 上午
 */

import javafx.application.Application;
import javafx.stage.Modality;
import javafx.stage.Stage;

public class StageExample extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Stage示例");

        Stage stage = new Stage();  // 创建另一个 stage
        stage.setTitle("新建窗口");
        stage.setX(100.0);
        stage.setY(100.0);
        stage.setWidth(300);
        stage.setHeight(150);
        stage.initModality(Modality.APPLICATION_MODAL); // 设置模态
        // stage.initModality(Modality.WINDOW_MODAL);
        // stage.initModality(Modality.NONE);

        primaryStage.show();

        stage.showAndWait();
    }
}
